// dlg.txt
//MK Edit

//mark_quest_dest(zone,x,y,layer,quest);
//	code =
//		sf(,,2);
//		toggle_quest(19,10);
//		award_party_xp(MED_QUEST_XP);
//	break;

begintalkscript;

variables;

short this_town = 17;

begintalknode;
	tag = 1;
	condition = get_sdf(this_town,1) == 0;
	text1 = "You walk up the path to Walkwood Mines. Signs identify it as a claim of Haven. Should be a good source of resources.";
	text2 = "Travel is kind of slow. As you walk, little tendrils of root reach out of the ground and grab your feet.";
	text3 = "The Havenites are up ahead. It's an odd display. Instead of being safely indoors, they are all camped out here. The path is blocked by a wall of trees. In the camp, several soldiers guard a group of hungry, dispirited prisoners. All is not well here.";
	code =
		sf(this_town,1,1);
	break;
	
begintalknode;
	tag = 2;
	condition = get_sdf(this_town,2) == 0;
	text1 = "You cross the bridge into the woods west of the river. You can see a pile of iron ore nearby, all portioned out into carefully weighted bags. The rapidly advancing roots have not yet buried it. The iron seems to keep them away.";
	text2 = "The roots do keep grabbing at your feet, though. The forest is more active out here. No humans have been out here for weeks.";
	code =
		sf(this_town,2,1);
	break;

begintalknode;
	tag = 3;
	condition = get_sdf(this_town,3) == 0 && gf(17,20) == 0;
	text1 = "You emerge into the clearing surrounding the mine workshop and barracks. Fortunately, most of Haven's facilities here are still intact. All the iron slowed the roots down.";
	text2 = "You hear a crash to the south, followed by a cheer. The convicts have managed to chop away the trees blocking the path.";
	code =
		sf(17,20,1);
		sf(this_town,3,1);
	break;

begintalknode;
	tag = 4;
	condition = get_sdf(this_town,4) == 0;
	text1 = "You enter the mines. The convicts chopped away the roots blocking the door, but they didn't set one foot inside. Cowards.";
	text2 = "You smell freshly-turned earth. Vines and roots protrude out of the dirt walls at crazy angles. It's like the forest is closing a fist around the tunnels, ready to crush them. The side galleries have already collapsed. Soon, this mine will be useless.";
	text3 = "You reach down and touch the earth. It is vibrating slightly.";
	code =
		sf(this_town,4,1);
	break;

begintalknode;
	tag = 5;
	condition = get_sdf(this_town,5) == 0 && gf(17,11) == 0;
	text1 = "In the middle of the grove ahead, you see a hulking monstrosity, a huge tangle of roots forming a parody of a human shape. You can sense the power radiating off of it. It was not hard to find the source of the hostile magic above-ground. It is a huge and formidable beast.";
	text2 = "You note that three paths enter the grove. Each has a single, narrow path of rich grass running along it. You touch the path. It feels warm. Something nearby is feeding power into the grove and, from there, into the beast.";
	code =
		sf(this_town,5,1);
	break;

begintalknode;
	tag = 6;
	condition = get_sdf(this_town,6) == 0 && gf(17,12) == 0 && gf(17,16) == 0;
	text1 = "The mine tunnels open up into a huge, natural cavern. Roots have torn up the stone floors in patches, enabling huge clumps of roots to grow into the cave.";
	text2 = "The roots form four more of those huge root monsters. They are moist and fresh and only barely formed. When you enter the cave, they immediately react. They begin to struggle. The roots holding them to the ground break, so that they can lurch after you.";
	text3 = "It looks like the one to the northeast will break loose first.";
	code =
		sf(this_town,6,1);
		sf(17,16,1);
	break;

begintalknode;
	tag = 7;
	condition = get_sdf(this_town,7) == 0 && gf(17,12) == 0;
	text1 = "Roots reach out of the dirt and grab your ankles. Not unusual. Except this time, the roots are thick, and they hold on. You are held immobilized.";
	text2 = "As you try to break free, the ground starts to shake. Roots shoot out of the ground ahead of and behind you. They knot themselves into horrible humanish forms and lurch toward you.";
	code =
		sf(this_town,7,1);
		set_char_status(30000,12,6 + difficulty());
		sf(17,15,1);
		activate_hidden_group(7);
	break;

begintalknode;
	tag = 8;
	condition = get_sdf(this_town,8) == 0;
	text1 = "__";
	code =
		sf(this_town,8,1);
	break;

begintalknode;
	tag = 9;
	condition = get_sdf(this_town,9) == 0;
	text1 = "__";
	code =
		sf(this_town,9,1);
	break;

begintalknode;
	tag = 10;
	condition = get_sdf(this_town,10) == 0;
	text1 = "__";
	code =
		sf(this_town,10,1);
	break;

begintalknode;
	tag = 11;
	condition = get_sdf(this_town,11) == 0;
	text1 = "__";
	code =
		sf(this_town,11,1);
	break;

begintalknode;
	tag = 12;
	condition = get_sdf(this_town,12) == 0;
	text1 = "__";
	code =
		sf(this_town,12,1);
	break;

// MIXED

begintalknode;
	tag = 13;
	condition = 1;
	text1 = "You try to open the doors to the mine, but they won't budge. Roots are holding them shut. The workers here will need some time to chop them loose.";

begintalknode; // 
	tag = 14;
	condition = 1;
	text1 = "I'm innocent!";
	text2 = "I didn't do nothing!";
	text3 = "They work us too hard.";
	text4 = "We need more food!";
	text5 = "The trees will kill us!";
	text6 = "Pardon me!";
	action = SPEECH_BUBBLE;
	code =
		cs();
		as(get_ran(1,1,6));
	break;

begintalknode;
	tag = 15;
	condition = 1;
	text1 = "We watch the convicts.";
	text2 = "Get back to work, you!";
	text3 = "Welcome, [P].";
	text4 = "We do our best.";
	text5 = "(Salutes!)";
	action = SPEECH_BUBBLE;
	code =
		cs();
		as(get_ran(1,1,5));
	break;

begintalknode;
	tag = 16;
	condition = 1;
	text1 = "The root horror has finally taken too much damage to hold itself together. It collapses to the ground, a tangle of rotting vegetation. You instantly feel the forest growing less oppressive. The Havenites don't have to worry about being strangled. On the surface, anyway.";
	text2 = "You can still sense powerful magic here, under your feet. There is still much work to be done here.";

begintalknode;
	tag = 17;
	condition = 1;
	text1 = "You managed to do some damage to the root horror. It sinks a thick root into the damp soil. The woody extension pulses grotesquely, drawing energy out of the earth. Not only are some of the horror's wounds mended, but it seems stronger now.";
	text2 = "Something somewhere is feeding this nightmare.";

begintalknode;
	tag = 18;
	condition = 1;
	text1 = "You destroy the final root monster hiding in the bottom of the mine. The roots immediately calm down. The hostile magic in the air fades away. The Kranas Woods are huge and full of power, but they can't resist the concentrated power of Haven.";
	text2 = "Haven will be able to extract precious iron from this mine as soon as the convicts are beaten into action.";

begintalknode;
	tag = 19;
	condition = 1;
	text1 = "__";

begintalknode;
	tag = 20;
	condition = 1;
	text1 = "__";

begintalknode;
	tag = 21;
	condition = 1;
	text1 = "__";

begintalknode;
	tag = 22;
	condition = 1;
	text1 = "__";

//// Sergeant Dillon

begintalknode;
	tag = 30;
	state = -1;
	nextstate = 10;
	condition = 1;
	question = "Name";
	text1 = "You meet an armed soldier of Haven. She stands at the alert, sword at the ready. Most of the other people here are convicts: Criminals of Haven who are paying for their crimes by working out here in the wilderness.";
	text2 = "Discipline is pretty lax out here. The soldier brushes some dried food off of her armor, runs up to you, and sort of salutes. _What ... What an honor! We didn't know we would get the [P] out here. I am Sergeant Dillon._";
	text3 = "She shouts at the convicts, _Show some respect, worms! A [P] has come to help us through all our troubles._";
	text5 = "Sergeant Dillon doesn't really know how to react to your presence, so she just stands stiffly at attention all the time. The effort is draining for her. Bits of sweat bead out on her face, and she is breathing heavily.";
	action = INTRO;

begintalknode;
	state = 10;
	nextstate = -1;
	condition = gf(17,13) == 0;
	question = "_Don't get too excited. I'm just passing through._";
	text1 = "_Oh. Well, we aren't really able to properly host one of your status anyway. Not many comforts right now. We're too busy worrying about the trees attacking us._";
	code =
		sf(17,13,1);
	break;

begintalknode;
	state = 10;
	nextstate = -1;
	condition = gf(17,13) == 0;
	question = "_Hello, Sergeant. I am [P] [N] of Haven._";
	text1 = "_It is such an honor. And a bit of good news. The trees are attacking us. We weren't really prepared for that, begging your pardon._";
	code =
		sf(17,13,1);
	break;

begintalknode;
	state = 10;
	nextstate = -1;
	condition = gf(17,13) == 0;
	question = "_Give your situation, Sergeant._";
	text1 = "_Well, we know you have high expectations of us. I'm sorry, but we aren't really meeting them. We are operating at below peak efficiency, as trees are attacking us._";
	code =
		sf(17,13,1);
	break;
	
begintalknode;
	state = 10;
	nextstate = 11;
	condition = gf(17,13) > 0;
	question = "_Tell me about the Kranas._";
	text1 = "_Ah. Yes. The forest._";
	text2 = "She looks at the trees that surround her. They look like they could all rush in on you at any moment, eradicating any sign that you were ever here.";
	text3 = "_The vassals here are all right, I guess. I've seen worse. The governor has things under control. Everything except the forest._";
	code =
		if (gf(17,11) > 0)
			rs(2);
	break;
	
begintalknode;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "_How have the Ro treated you?_";
	text1 = "_Oh, they are always perfect. Smiling. Kind. Say all the right things. But that's just how the Ro are. Don't be fooled. My great-grandfather fought in the Great Uprising. They were nice then, too. Right up to the killing._";

begintalknode;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "_Tell me about the Governor._";
	text1 = "_Governor Yvette keeps control of everything. She watches all, and she's always looking for advantage._ A pause. _For Haven, I mean._";
	text2 = "This soldier is not foolish enough to say anything bad about the governor.";

begintalknode;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "_Tell me about their forest._";
	text1 = "_Well, it's been ... attacking. Hostile. Started about a year ago. The Ro say the groves are angry. Don't know what that means._";
	text2 = "_I know the trees here are angry. Their roots come out of the ground and attack us. Happened in the mines first. Then out here on the surface._";

begintalknode;
	state = 10;
	nextstate = 12;
	condition = gf(17,13) > 0;
	question = "_Haven has a mine here._";
	text1 = "_We do. Haven trades for a lot of iron in the Kranas, but this is the only mine we control ourselves. It's a good one, too. We have piles of ore out in the west woods, waiting for Governor Yvette to ... use it as she wishes._";
	text2 = "As she talks, she constantly watches the convicts. They're a hungry, dispirited bunch, but Dillon isn't going to be caught by surprise.";

begintalknode;
	state = 12;
	nextstate = -1;
	condition = 1;
	question = "_Where does the iron go?_";
	text1 = "_I'm just a sergeant. I can't question the governor. I'm sure she is very wise and uses it all for the good of Haven._";

begintalknode;
	state = 12;
	nextstate = -1;
	condition = 1;
	question = "_How did you claim this land?_";
	text1 = "_I think we got it about twenty years ago, not long after Yvette became governor. Don't know how she got the Raasa to deed this land to us. Paying a lot of money, most likely._";

begintalknode;
	state = 12;
	nextstate = 13;
	condition = 1;
	question = "_Who are your workers?_";
	text1 = "_Convicts. Thieves. Smugglers. That sort of thing. Minor criminals. They get sent out here for five year terms, to learn how to be better citizens._";
	
begintalknode;
	state = 13;
	nextstate = -1;
	condition = 1;
	question = "_Ever have any problems with them?_";
	text1 = "One of them looks up at her. She sneers at him. He looks down again. _Oh, of course. They're criminals. Not great workers. We have ways to motivate them. Don't worry. They produce for us._";

begintalknode;
	state = 13;
	nextstate = -1;
	condition = 1;
	question = "_Any escape attempts?_";
	text1 = "_Oh no! That's one thing we don't have to worry about. Anyone who runs off into the Kranas Woods gets got, by trees or brigands. They know this is the only place they can be safe._";

begintalknode;
	state = 10;
	nextstate = 14;
	condition = gf(17,11) == 0 && gf(17,13) > 0;
	question = "_So what is the problem here?_";
	text1 = "_Roots. The woods are angry. It sends wads of roots out of the ground to strangle us._";
	text2 = "";

begintalknode;
	state = 14;
	nextstate = -1;
	condition = 1;
	question = "_You're trapped outside your barracks?_";
	text1 = "_Sad story, that. We were hiding in the barracks. Then the whole building started to shake, like the roots had grabbed it. We ran out here, and the trees shot up behind us. Never seen anything like it!_";
	text2 = "_We were getting ready to make a run for [F1] when you arrived._";

begintalknode;
	state = 14;
	nextstate = -1;
	condition = 1;
	question = "_Lose any workers?_";
	text1 = "_We did, in the first attack on the surface. Didn't think they could get us up here. Some Havenite prisoners were hauling ore in the woods to the west. The roots reached out and grabbed them. They couldn't get out. Their screams ..._ She shakes her head.";
	text2 = "_None of us have gone out there since._";

begintalknode;
	state = 14;
	nextstate = -1;
	condition = 1;
	question = "_What can I do to help?_";
	text1 = "_I don't know. You're a [P]. I can't say anything about what you should do. I get my orders from Chief Tereza in [F1]. She's a good one to talk to about this._";
	text2 = "_If you forced me to give advice, though, fire and steel would probably be a good place to start._";

begintalknode;
	state = 14;
	nextstate = -1;
	condition = 1;
	question = "_You know something? I could use more iron._";
	text1 = "_And we have it! Tons of ore, piled up in the woods. We could send it wherever you want. All we need is someone to chop back the roots._";
	text2 = "_Chief Tereza in [F1] could tell you more._";

begintalknode;
	state = 10;
	nextstate = -1;
	condition = gf(17,11) > 0 && gf(17,13) == 1;
	question = "_I cleared the horrors out of the groves to the west._";
	text1 = "Sergeant Dillon brightens up. _You hear that, scum? You can rescue the ore from the woods now. Put it to work for the good of Haven! Let's hear a cheer!_ The prisoners let out a few half-hearted grunts.";
	text2 = "_Thank you, [P]. We'll reclaim our barracks. I'm sure Chief Tereza would love to hear about this. She is in [F1]._";
	code =
		sf(17,13,2);
	break;
	
begintalknode;
	state = 10;
	nextstate = -1;
	condition = gf(17,11) > 0 && gf(17,19) == 0;
	question = "_I could use more supplies._";
	text1 = "_Of course, [P]! Now that we can get back into our hall, I'll have the military supply bay opened for you. Can't let the prisoners in there. Sure you understand._";
	code =
		sf(17,19,1);
	break;
	
begintalknode;
	state = 10;
	nextstate = 15;
	condition = gf(17,11) > 0 && gf(17,12) == 0;
	question = "_Any other problems?_";
	text1 = "_Well, we have taken the surface, it's true. However, the roots are still down in the mines, looking to strangle._";

begintalknode;
	state = 15;
	nextstate = -1;
	condition = 1;
	question = "_You're Havenites! Why don't you clear out the mines?_";
	text1 = "_I'm sorry, [P]. The convicts aren't reliable fighters, and I just don't have enough soldiers for a job like that. Or enough things that burn._";

begintalknode;
	state = 15;
	nextstate = -1;
	condition = 1;
	question = "_I can investigate the mines._";
	text1 = "_I know Prince Sutter and you are accomplished hunters. Bet this is just another fun adventure for you!_ She laughs.";

begintalknode;
	state = 10;
	nextstate = 16;
	condition = gf(17,12) > 0 && gf(17,13) == 2;
	question = "_I cleaned out the mines for you._";
	text1 = "_We knew you would! Prince Sutter and you are famous warriors._";
	text2 = "She turns to the convicts. _Hear that, scum? No more relaxing. Back into the mines with you._";

begintalknode;
	state = 16;
	nextstate = -1;
	condition = 1;
	question = "_Yeah! Get back to work!_";
	text1 = "Shouting at villains is actually very therapeutic. You feel directly involved in the justice system of Haven. The scum prepares to trudge back into the pit.";
	action = END_TALK;
	
begintalknode;
	state = 16;
	nextstate = -1;
	condition = 1;
	question = "_You work for your [P] and the glory of Haven!_";
	text1 = "They look at the ground and grunt. Your speech didn't really inspire them. They prepare to trudge back into the pit.";
	action = END_TALK;
	
//

begintalknode;
	tag = 40;
	state = -1;
	nextstate = 40;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

	
//

begintalknode;
	tag = 70;
	state = -1;
	nextstate = 70;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";


//

begintalknode;
	tag = 100;
	state = -1;
	nextstate = 100;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 100;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

//

begintalknode;
	tag = 130;
	state = -1;
	nextstate = 130;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 130;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

//

begintalknode;
	tag = 160;
	state = -1;
	nextstate = 160;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 160;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";
		
//

begintalknode;
	tag = 190;
	state = -1;
	nextstate = 190;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 190;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";
				